
package com.verify.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.verify.data.domain.ExcelPersonnel;
import com.verify.data.domain.ExcelUnit;
import com.verify.mapper.ExcelPersonnelMapper;
import com.verify.mapper.ExcelUnitMapper;
import com.verify.repository.base.BaseRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
@RequiredArgsConstructor
public class ExcelPersonnelRepository extends BaseRepository<ExcelPersonnelMapper, ExcelPersonnel>
        implements IService<ExcelPersonnel> {
    public List<ExcelPersonnel> listByLikeCode(String code) {
        return list(baseQuery().likeLeft(ExcelPersonnel::getCode, code));
    }

    public ExcelPersonnel getByCode(String code) {
        return getOne(baseQuery().eq(ExcelPersonnel::getCode, code));
    }

    public ExcelPersonnel getByCode(String code,String orgCode) {
        return getOne(baseQuery().eq(ExcelPersonnel::getCode, code).eq(ExcelPersonnel::getOrgCode, orgCode));
    }
}
